<?Lassoscript
// Last modified 12/15/11 by ECL

// FUNCTIONALITY
// This file does a lookup on the slider config settings.
// It is called from the "Edit Slider Group" page, by selecting one of the "Slider Type" dropdowns, such as "SudoSlider"
// (e.g. http://dev.itpage.local/app/modules/admin/controllers/setup_editrecord.lasso?ID=1&New=Y&Datatype=SliderGroup

// Process the request from the select
Var('SliderTypeIDSubmit' = Action_Param('SliderTypeID'));
Var('SliderConfigIDSubmit' = Action_Param('SliderConfigID'));
// If NO $SliderConfigIDSubmit is submit, that means it's an ADD, so we set the default to SudoSlider (id=1)
If($SliderConfigIDSubmit != '');
//	'SliderConfigIDSubmit selected: '+($SliderConfigIDSubmit)+'<br>\n';
Else;
	$SliderConfigIDSubmit = 0;
//	'SliderConfigIDSubmit NOT selected, setting to '+($SliderConfigIDSubmit)+'<br>\n';
/If;

// Get Slider config records and build the form fields
Var('SQLGetFormFields' = (StripBackticks('SELECT ST.Slider_Type, SliderConfigName, SliderConfigValue FROM cms_slidertype AS ST
LEFT JOIN cms_sliderconfig AS SC
ON (ST.Slider_SliderTypeID=SC.Slider_SliderTypeID)
WHERE ST.Slider_SliderTypeID='+($SliderTypeIDSubmit)+'
AND SC.SG_GroupID='+($SliderConfigIDSubmit)+'
ORDER BY ID')));
Inline(-Database=$svSiteDatabase, -Table=$svSliderConfigTable, -SQL=$SQLGetFormFields);
('<!-- lookup_sliderconfigs.lasso -->\n');
('<!-- SliderTypeIDSubmit = '+($SliderTypeIDSubmit)+' -->\n');
('<!-- SliderConfigIDSubmit = '+($SliderConfigIDSubmit)+' -->\n');
('<!-- SQLGetFormFields = '+($SQLGetFormFields)+' -->\n');
	If(Found_Count > 0);
?>
	<tr>
		<td class="SecondaryLabel"><label for="SliderTypeSettings" class="SecondaryLabel">SliderType Settings</label></td><td class="SecondaryLabel"></td>
	</tr>
<?Lassoscript
		Records;
		'\t<tr>\n';
		('\t\t<td width="120" class="tablehead_10_white_right_secondary">'+(Field('SliderConfigName'))+'</td>\n');
		('\t\t<td width="280" bgcolor="#f0f0f0"><input type="text" name="'+(Field('SliderConfigName'))+'" value="'+(Field('SliderConfigValue'))+'"></td>\n');
		'\t</tr>\n';
		/Records;
	/If;
/Inline;
?>
